package com.aoxiang.earlywaringapi.service.impl;

import com.aoxiang.earlywaringapi.module.BaseHouseholdInfo;
import com.aoxiang.earlywaringapi.repository.BaseHouseholdInfoRepository;
import com.aoxiang.earlywaringapi.service.BaseHouseholdInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author teevil@126.com
 * @date 2021/6/29
 */
@Service
public class BaseHouseholdInfoServiceImpl implements BaseHouseholdInfoService {
    private final BaseHouseholdInfoRepository baseHouseholdInfoRepository;

    public BaseHouseholdInfoServiceImpl(BaseHouseholdInfoRepository baseHouseholdInfoRepository) {
        this.baseHouseholdInfoRepository = baseHouseholdInfoRepository;
    }

    @Override
    public List<BaseHouseholdInfo> getListByCountryHouseholdNo(String countryHouseholdNo) {
        return this.baseHouseholdInfoRepository.findBaseHouseholdInfosByCountryHouseholdNo(countryHouseholdNo);
    }

    @Override
    public List<BaseHouseholdInfo> getListByIdCard(String idCard) {
        return this.baseHouseholdInfoRepository.findBaseHouseholdInfoByIdCard(idCard);
    }
}
